import { useLocation } from 'react-router-dom'
// import routes from './routes'

import Content from './components/Content';
import CityList from './pages/CityList';
import Map from './pages/Map';

import './app.scss'
function App() {
  //根据路由表生成对应的路由规则
  // const element = useRoutes(routes)
  let location = useLocation();
  console.log(location);
  return (
    <div className="App">
      {
        location.pathname === '/map' ? <Map /> : location.pathname ==='/citylist' ? <CityList/> : <Content/>
      }
    </div>
  );
}

export default App;
